//
//  UIImageView+Extension.swift
//  MT
//
//  Created by ooops on 2020/1/2.
//  Copyright © 2020 张强. All rights reserved.
//

import Foundation


extension UIImageView {
    
    func mtSetImage(_ url: String? = nil, _ placeholder: String? = nil) {
        if let avator = url {
            if placeholder == nil {
                self.kf.setImage(with: URL(string: avator), placeholder: UIImage(named: defaultPlaceholderIcon60x60))
            } else {
                self.kf.setImage(with: URL(string: avator), placeholder: UIImage(named: placeholder!))
            }
        } else {
            self.image = UIImage(named: defaultPlaceholderIcon60x60)
        }
    }
    
}
